#ifndef OPENHARMONYMEDIARECORDER_H
#define OPENHARMONYMEDIARECORDER_H

#include "qobject.h"
#include "qsharedpointer.h"

QT_BEGIN_NAMESPACE

class QOpenHarmonyJsObject;
class OPenHarmonyMediaRecorder : public QObject
{
    Q_OBJECT
public:
    enum AudioEncoder {
        AAC = 1,
        VORBIS = 2,
        FLAC = 3
    };

    enum AudioSource {
        Mic = 0
    };

    enum VideoEncoder {        
        H263 = 0,
        AVC = 1,
        MPEG_2 = 2,
        MPEG_4 = 3,
        VP8 = 4
    };

    enum VideoSource {
        YUV = 0,
        ES = 1
    };

    enum OutputFormat {
        CFT_MPEG_4 = 0,
        CFT_MPEG_4A = 1,
    };

    OPenHarmonyMediaRecorder();
    ~OPenHarmonyMediaRecorder();

    void release();
    bool prepare();
    void reset();

    bool start();
    void stop();

    void setAudioChannels(int numChannels);
    void setAudioEncoder(AudioEncoder encoder);
    void setAudioEncodingBitRate(int bitRate);
    void setAudioSamplingRate(int samplingRate);
    void setAudioSource(AudioSource source);

Q_SIGNALS:
    void error(int what, int extra);
    void info(int what, int extra);

private:
    qptrdiff m_id;
    QSharedPointer<QOpenHarmonyJsObject> m_mediaRecorder;
};

QT_END_NAMESPACE
#endif // OPENHARMONYMEDIARECORDER_H
